package org.example.controller;

import jakarta.annotation.Resource;
import org.example.bean.Order;
import org.example.service.OrderService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther:Liu
 * @Testname:OrderController
 * @Date:2025/9/25 15:36
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Resource
    private OrderService orderService;

    @PostMapping
    public String create( Order order) {
        int i = orderService.createOrder(order);
        return i == 1 ? "成功" : "失败";
    }
}
